//
//  CarCell.m
//  AnnCar_user
//
//  Created by LiBenCan on 17/10/26.
//  Copyright © 2017年 LiBenCan. All rights reserved.
//

#import "CarCell.h"
#import "DefaultChooseView.h"
#import "UILabel+HWDUILabel.h"
@implementation CarCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        self.selectionStyle = 0;
//        [self creatUI];
    }
    return self;
}

- (void)creatUI
{
    if (!_carImageV) {
        
    }
}

//数据字典
-(void)setDataDic:(NSDictionary *)dataDic Section:(NSInteger)section
{
    //车标图片
    _carImageV = [TomamaUI createImageView:CGRectMake(15*screenW_6, 15*screenW_6, 36*screenW_6, 36*screenW_6) backGroundImageV:@"My_car2"];
    [self.contentView addSubview:_carImageV];
    
    //箭头
    _arrowImageV = [TomamaUI createImageView:CGRectMake(SCREENW-25*screenW_6, 18*screenW_6, 8*screenW_6, 14*screenW_6) backGroundImageV:@"My_arrow"];
    [self.contentView addSubview:_arrowImageV];
    
    
    //品牌
    _pinPaiLab = [TomamaUI createLabel:CGRectMake(CGRectGetMaxX(_carImageV.frame)+15*screenW_6,15*screenW_6,SCREENW-100*screenW_6,25*screenW_6) textAligment:0 font:[UIFont systemFontOfSize:15*screenW_6] textColor:blueColor text:@""];
    [self.contentView addSubview:_pinPaiLab];
    
    //车牌
    _paiLab = [TomamaUI createLabel:CGRectMake(CGRectGetMaxX(_carImageV.frame)+15*screenW_6,CGRectGetMaxY(_pinPaiLab.frame),SCREENW-100*screenW_6,25*screenW_6) textAligment:0 font:[UIFont systemFontOfSize:15*screenW_6] textColor:blueColor text:@""];
    [self.contentView addSubview:_paiLab];
    
    //颜色
    _colorLab = [TomamaUI createLabel:CGRectMake(CGRectGetMaxX(_carImageV.frame)+15*screenW_6,CGRectGetMaxY(_paiLab.frame),SCREENW-100*screenW_6,25*screenW_6) textAligment:0 font:[UIFont systemFontOfSize:15*screenW_6] textColor:blueColor text:@""];
    [self.contentView addSubview:_colorLab];
    
    //线条
    [self.contentView addSubview:[ToolViewVC addCellLineLab:CGRectMake(15*screenW_6,99*screenW_6, SCREENW-15*screenW_6, 1*screenW_6)]];
    
    //默认选择
    _deaultView = [[DefaultChooseView alloc]initWithFrame:CGRectMake(0,100*screenW_6, SCREENW, 50*screenW_6) IsSelect:section == 0?YES:NO];
    [self.contentView addSubview:_deaultView];
    __weak typeof(self)weakself = self;
    _deaultView.selectBlock = ^(NSInteger selectNumber){
        if (weakself.chooseBlock) {//回调选择的按钮
            weakself.chooseBlock(selectNumber);
        }
    };

    _pinPaiLab.text = [NSString stringWithFormat:@"品牌    %@",[ToolViewVC getNotNullStr:@"宝马"]];
    [_pinPaiLab setHighlightStirng:@"品牌" HighlightColor:TextBlack];
    _paiLab.text = [NSString stringWithFormat:@"车牌    %@",[ToolViewVC getNotNullStr:@"鄂A89898989"]];
    [_paiLab setHighlightStirng:@"车牌" HighlightColor:TextBlack];
    _colorLab.text = [NSString stringWithFormat:@"颜色    %@",[ToolViewVC getNotNullStr:@"红色"]];
    [_colorLab setHighlightStirng:@"颜色" HighlightColor:TextBlack];
}
@end
